<?
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
session_start();
require ("inc.php");
if ($_POST && $_SESSION['check_auth_number'] != $_POST['check_auth_number'])
{
	echo g::msg("验证码有误！登录失败！");
	g::gowin("index.php");
}elseif ($_POST)
{
	$db_admin = &new db($scfg['db']['admin']);
	if (admin_core::login($_POST['master'], $_POST['password']))
	{
		g::gowin($_POST['ourl']?$_POST['ourl']:"index.php");
	}else
	{
		echo g::msg("帐号或密码有误！登录失败！");
		g::gowin($_POST['eurl']?$_POST['eurl']:"login.php");
	}
}elseif($_REQUEST['act'] == "logout")
{
	admin_core::logout();
}
// 如果已登陆 跳开这里
if(admin_core::isLogin())
{
	g::gowin("index.php");
	exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?=$scfg['config']['SystemName']?> Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="static/login.css" rel="stylesheet" type="text/css" />
</head>
<script language="JavaScript">
if(self.parent.frames.length != 0) {
	self.parent.location=document.location;
}
function redirect(url) {
	window.location.replace(url);
}
</script>
<br />
<br />
<br />
<br />
<table width="600" border="0" cellpadding="8" cellspacing="0" class="logintable">
  <tr class="loginheader">
    <td width="80"></td>
    <td width="100"></td>
    <td></td>
    <td width="120"></td>
    <td width="80"></td>
  </tr>
  <tr style="height:40px">
    <td>&nbsp;</td>
    <td class="line1"><span style="color:#ffff66;font-size:14px;font-weight: bold;">系统设置</span> </td>
    <td class="line1"><?=$scfg['config']['SystemName']?></td>
    <td class="line1">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <form method="post" name="login">
    <input type="hidden" name="ourl" value="<?=$_REQUEST['ourl']?>">
    <input type="hidden" name="eurl" value="<?=$_SERVER['PHP_SELF']?>">
    <tr>
      <td>&nbsp;</td>
      <td align="right">用户名:</td>
      <td><input type="text" name="master" value="<?=$_REQUEST['master']?>" size="25" id="master" style="width:150px;"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td align="right">密    码:</td>
      <td><input type="password" name="password" value="<?=$_REQUEST['password']?>" size="25" id="password" style="width:150px;"></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
     <tr>
      <td>&nbsp;</td>
      <td align="right">认证码:</td>
      <td><input type="password" name="check_auth_number" size="4" id="check_auth_number">
       <img src="authcode.gif/index.php?<?=time()?>" width="85" height="24" /></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td class="line1">&nbsp;</td>
      <td class="line1" align="center"><input type="submit" class="button" value="提 交" />
  </form>
  <script language="JavaScript">
  document.login.master.focus();
  </script>
  </td>
  <td class="line1">&nbsp;</td>
    <td>&nbsp;</td>
  </tr><tr>
    <td>&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td class="line2">&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5" align="center">Powered by 
          <a href="<?=$scfg['config']['PoweredCorpUrl']?>" target="_blank" style="color: #fff"><b><?=$scfg['config']['PoweredCorpName']?></b></a>
          &nbsp;&copy; 2007-<?=date("Y")?> 
          <a href="<?=$scfg['config']['PoweredCorpUrl']?>" target="_blank" style="color: #fff"><?=$scfg['config']['PoweredCorpID']?> Inc.</a>
     </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</html>